package com.momo.mapper.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.momo.mapper.dataobject.UserInfoDO;
import com.momo.mapper.mapper.UserInfoDOMapper;

/**
* The Table USER_INFO.
* 注意:此结构有系统生成,禁止手工修改,以免被覆盖,请通过dalgen生成
* USER_INFO
*/
@Repository
public class UserInfoDAO{

    @Autowired
    private UserInfoDOMapper userInfoDOMapper;

    /**
     * desc:插入表:USER_INFO.<br/>
     * descSql =  SELECT LAST_INSERT_ID() INSERT INTO USER_INFO( NAME ,TELPHONE ,REGISTER_MODE ,THIRD_PARTY_ID ,AGE ,GENDER )VALUES( #{name,jdbcType=VARCHAR} ,#{telphone,jdbcType=VARCHAR} ,#{registerMode,jdbcType=VARCHAR} ,#{thirdPartyId,jdbcType=VARCHAR} ,#{age,jdbcType=INTEGER} ,#{gender,jdbcType=TINYINT} )
     * @param entity entity
     * @return int
     */
    public int insert(UserInfoDO entity){
        return userInfoDOMapper.insert(entity);
    }
    /**
     * desc:更新表:USER_INFO.<br/>
     * descSql =  UPDATE USER_INFO SET NAME = #{name,jdbcType=VARCHAR} ,TELPHONE = #{telphone,jdbcType=VARCHAR} ,REGISTER_MODE = #{registerMode,jdbcType=VARCHAR} ,THIRD_PARTY_ID = #{thirdPartyId,jdbcType=VARCHAR} ,AGE = #{age,jdbcType=INTEGER} ,GENDER = #{gender,jdbcType=TINYINT} WHERE ID = #{id,jdbcType=INTEGER}
     * @param entity entity
     * @return int
     */
    public int update(UserInfoDO entity){
        return userInfoDOMapper.update(entity);
    }
    /**
     * desc:根据主键删除数据:USER_INFO.<br/>
     * descSql =  DELETE FROM USER_INFO WHERE ID = #{id,jdbcType=INTEGER}
     * @param id id
     * @return int
     */
    public int deleteById(Integer id){
        return userInfoDOMapper.deleteById(id);
    }
    /**
     * desc:根据主键获取数据:USER_INFO.<br/>
     * descSql =  SELECT * FROM USER_INFO WHERE ID = #{id,jdbcType=INTEGER}
     * @param id id
     * @return UserInfoDO
     */
    public UserInfoDO getById(Integer id){
        return userInfoDOMapper.getById(id);
    }
}
